package cehadata;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

@Entity
@Table(name = "membre")
@NamedQueries({@NamedQuery(name = "Membre.findAll", query = "SELECT m FROM Membre m"), @NamedQuery(name = "Membre.findById", query = "SELECT m FROM Membre m WHERE m.id = :id"), @NamedQuery(name = "Membre.findByPseudo", query = "SELECT m FROM Membre m WHERE m.pseudo = :pseudo"), @NamedQuery(name = "Membre.findByPass", query = "SELECT m FROM Membre m WHERE m.pass = :pass"), @NamedQuery(name = "Membre.findByNom", query = "SELECT m FROM Membre m WHERE m.nom = :nom"), @NamedQuery(name = "Membre.findByPrenom", query = "SELECT m FROM Membre m WHERE m.prenom = :prenom"), @NamedQuery(name = "Membre.findByInitiale", query = "SELECT m FROM Membre m WHERE m.initiale = :initiale")})
public class Membre implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Short id;
    @Basic(optional = false)
    @Column(name = "pseudo")
    private String pseudo;
    @Basic(optional = false)
    @Column(name = "pass")
    private String pass;
    @Column(name = "nom")
    private String nom;
    @Column(name = "prenom")
    private String prenom;
    @Basic(optional = false)
    @Column(name = "initiale")
    private String initiale;

    public Membre() {
    }

    public Membre(Short id) {
        this.id = id;
    }

    public Membre(Short id, String pseudo, String pass, String initiale) {
        this.id = id;
        this.pseudo = pseudo;
        this.pass = pass;
        this.initiale = initiale;
    }

    public Short getId() {
        return id;
    }

    public void setId(Short id) {
        this.id = id;
    }

    public String getPseudo() {
        return pseudo;
    }

    public void setPseudo(String pseudo) {
        this.pseudo = pseudo;
    }

    public String getPass() {
        return pass;
    }

    public void setPass(String pass) {
        this.pass = pass;
    }

    public String getNom() {
        return nom;
    }

    public void setNom(String nom) {
        this.nom = nom;
    }

    public String getPrenom() {
        return prenom;
    }

    public void setPrenom(String prenom) {
        this.prenom = prenom;
    }

    public String getInitiale() {
        return initiale;
    }

    public void setInitiale(String initiale) {
        this.initiale = initiale;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Membre)) {
            return false;
        }
        Membre other = (Membre) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "cehadata.Membre[id=" + id + "]";
    }
}
